﻿//----------------------------------------------------------------
// Desc: CSV文件读取
// Edit: ShowLong, http://blog.csdn.net/showlong
//
// Date Created: 2011-01-17
//
// Update Date : 
//
// Copyright (c) Fuel4D (http://www.fuel4d.com), All rights reserved.
//
//----------------------------------------------------------------
#pragma once


FINLINE bool IFCSV::Open (const NCHAR* filename)
{
#ifdef UNICODE
    return OpenW(filename);
#else
    return OpenA(filename);
#endif
}

FINLINE const NCHAR* IFCSV::GetFilename ()
{
#ifdef UNICODE
    return GetFilenameW();
#else
    return GetFilenameA();
#endif
}

FINLINE const NCHAR* IFCSV::GetColumnName (short idx)
{
#ifdef UNICODE
    return GetColumnNameW(idx);
#else
    return GetColumnNameA(idx);
#endif
}

FINLINE short IFCSV::GetColumnIndex (const NCHAR* name)
{
#ifdef UNICODE
    return GetColumnIndexW(name);
#else
    return GetColumnIndexA(name);
#endif
}

FINLINE const NCHAR* IFCSV::GetString(short idx)
{
#ifdef UNICODE
    return GetStringW(idx);
#else
    return GetStringA(idx);
#endif
}

FINLINE bool IFCSV::GetString (short idx, FString & out)
{
#ifdef UNICODE
    return GetStringW(idx, out);
#else
    return GetStringA(idx, out);
#endif
}